package com.example.leetcode.math;

/*
 * // This is the custom function interface.
 * // You should not implement it, or speculate about its implementation
 * class CustomFunction {
 *     // Returns f(x, y) for any given positive integers x and y.
 *     // Note that f(x, y) is increasing with respect to both x and y.
 *     // i.e. f(x, y) < f(x + 1, y), f(x, y) < f(x, y + 1)
 *     public int f(int x, int y);
 * };
 */

import com.example.leetcode.math.common.MathUtils;
import com.example.leetcode.math.common.strategy.CustomFunction;
import com.example.leetcode.math.common.strategy.CustomFunctionContext;

import java.util.List;

class Solution1237 {
    public List<List<Integer>> findSolution(CustomFunction customfunction, int z) {
        return MathUtils.findSolution(customfunction, z);
    }
}

public class leetcode1237 {
    public static void main(String[] args) {
        Solution1237 solution1237 = new Solution1237();
        test1237(solution1237, 1, 5);
        test1237(solution1237, 3, 6);
    }

    private static void test1237(Solution1237 solution1237, int function_id, int z) {
        CustomFunction customfunction = getCustomFunctionById(function_id);
        System.out.println(solution1237.findSolution(customfunction, z));
    }

    private static CustomFunction getCustomFunctionById(int function_id) {
        CustomFunctionContext context = new CustomFunctionContext();
        return context.isOK(function_id);
    }
}
